package service.Impl;



import dao.SourceDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Source;
import service.SourceService;

import java.util.List;
import java.util.Map;

@Service
public class SourceServiceImpl implements SourceService {

    @Autowired
    private SourceDao sourceDao;

    @Override
    public List<Source> getAllSources() {
        return sourceDao.getAllSources();
    }

    @Override
    public List<Source> getSourcesByDate(String date) {
        return sourceDao.getSourcesByDate(date);
    }

    @Override
    public List<Source> getSourcesByDepartment(String departmentName) {
        return sourceDao.getSourcesByDepartment(departmentName);
    }

    @Override
    public int updateRemainingSources(String doctorId, String date, String morningWork) {
        // 可添加业务逻辑，如判断是否还有剩余号源
        return sourceDao.updateRemainingSources(doctorId, date, morningWork);
    }

    @Override
    public Source getUpdatedSource(String doctorId, String date) {
        return sourceDao.getUpdatedSource(doctorId, date);
    }

    @Override
    public List<Map<String, Object>> countSourcesByDepartment(String date) {
        return sourceDao.countSourcesByDepartment(date);
    }

    @Override
    public List<Source> getDoctorSchedule(String doctorId) {
        return sourceDao.getDoctorSchedule(doctorId);
    }
}